# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ayatana-indicator-session
pkgver=22.2.0
pkgrel=0
pkgdesc="Ayatana Indicator Session Applet"
url="https://github.com/AyatanaIndicators/ayatana-indicator-session"
arch="all"
license="GPL-3.0-only"
makedepends="
	cmake
	cmake-extras
	glib-dev
	gtest-dev
	intltool
	libayatana-common-dev
	"
checkdepends="dbus"
subpackages="$pkgname-lang"
source="https://github.com/AyatanaIndicators/ayatana-indicator-session/archive/$pkgver/ayatana-indicator-session-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
94a8852cf744a0d4a0e2289c66fe931c23abc31c32bdfdab4169d12e3968e28b2f70939f455c05a2e6d3669cedab1c5862500e48dc3c8516cb44ef63ee840754  ayatana-indicator-session-22.2.0.tar.gz
"
